import React from 'react'
import { Outlet, useNavigate } from 'react-router-dom'

export default function Home() {
    const navigate=useNavigate()
    const toMusicHandle = () => {
        navigate('/main/home/music/001/?user=xyue',{
            state:[{
                id:'001',name:'夜的第七章'
            },{
                id:'002',name:'爷爷泡的茶'
            },{
                id:'003',name:'双截棍'
            },{
                id:'004',name:'最伟大的作品'
            },{
                id:'005',name:'青花瓷'
            }]
        })
    }
    const toNewsHandle = () => {
        navigate('/main/home/news/001/?user=yuex',{
            state: [
              { id: "001", name: "空间站国旗与地球同框" },
              { id: "002", name: "罗永浩谈钟薛高卖得贵" },
              { id: "003", name: "麦当劳员工将掉地上面包放回货架" },
            ]
          })
    }
    
    return (
        <div>
            <h2> 我是Home的内容</h2>
            <button onClick={toMusicHandle}>Music</button>
            <button onClick={toNewsHandle}>News</button>
            <Outlet />
        </div>
    )
}
